home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 21 / AACD 21.iso / AACD / Utilities / Ghostscript / src / gsdevice.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-01-01  |  4.4 KB  |  125 lines

  1. /* Copyright (C) 1994, 2000 Aladdin Enterprises.  All rights reserved.
  2.   
  3.   This file is part of AFPL Ghostscript.
  4.   
  5.   AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
  6.   distributor accepts any responsibility for the consequences of using it, or
  7.   for whether it serves any particular purpose or works at all, unless he or
  8.   she says so in writing.  Refer to the Aladdin Free Public License (the
  9.   "License") for full details.
  10.   
  11.   Every copy of AFPL Ghostscript must include a copy of the License, normally
  12.   in a plain ASCII text file named PUBLIC.  The License grants you the right
  13.   to copy, modify and redistribute AFPL Ghostscript, but only under certain
  14.   conditions described in the License.  Among other things, the License
  15.   requires that the copyright notice and this notice be preserved on all
  16.   copies.
  17. */
  18.  
  19. /*$Id: gsdevice.h,v 1.3 2000/09/19 19:00:27 lpd Exp $ */
  20. /* Device and page control API */
  21.  
  22. #ifndef gsdevice_INCLUDED
  23. #  define gsdevice_INCLUDED
  24.  
  25. #ifndef gx_device_DEFINED
  26. #  define gx_device_DEFINED
  27. typedef struct gx_device_s gx_device;
  28. #endif
  29.  
  30. #ifndef gx_device_memory_DEFINED
  31. #  define gx_device_memory_DEFINED
  32. typedef struct gx_device_memory_s gx_device_memory;
  33. #endif
  34.  
  35. #ifndef gs_matrix_DEFINED
  36. #  define gs_matrix_DEFINED
  37. typedef struct gs_matrix_s gs_matrix;
  38. #endif
  39.  
  40. #ifndef gs_param_list_DEFINED
  41. #  define gs_param_list_DEFINED
  42. typedef struct gs_param_list_s gs_param_list;
  43. #endif
  44.  
  45. /* Device procedures not involving a graphics state. */
  46.  
  47. int gs_opendevice(P1(gx_device *));
  48. int gs_copyscanlines(P6(gx_device *, int, byte *, uint, int *, uint *));
  49. const gx_device *gs_getdevice(P1(int));
  50. int gs_copydevice(P3(gx_device **, const gx_device *, gs_memory_t *));
  51. /*
  52.  * If keep_open is true and dev->is_open is true, the copy *may* have
  53.  * is_open = true; otherwise, the copy will have is_open = false.
  54.  * copydevice is equivalent to copydevice2 with keep_open = false.
  55.  */
  56. int gs_copydevice2(P4(gx_device **pnew_dev, const gx_device *dev,
  57.               bool keep_open, gs_memory_t *mem));
  58.  
  59. #define gs_makeimagedevice(pdev, pmat, w, h, colors, colors_size, mem)\
  60.   gs_makewordimagedevice(pdev, pmat, w, h, colors, colors_size, false, true, mem)
  61. int gs_makewordimagedevice(P9(gx_device ** pnew_dev, const gs_matrix * pmat,
  62.                   uint width, uint height,
  63.                   const byte * colors, int num_colors,
  64.                   bool word_oriented, bool page_device,
  65.                   gs_memory_t * mem));
  66.  
  67. #define gs_initialize_imagedevice(mdev, pmat, w, h, colors, colors_size, mem)\
  68.   gs_initialize_wordimagedevice(mdev, pmat, w, h, colors, color_size, false, true, mem)
  69. int gs_initialize_wordimagedevice(P9(gx_device_memory * new_dev,
  70.                      const gs_matrix * pmat,
  71.                      uint width, uint height,
  72.                      const byte * colors, int colors_size,
  73.                      bool word_oriented, bool page_device,
  74.                      gs_memory_t * mem));
  75. const char *gs_devicename(P1(const gx_device *));
  76. void gs_deviceinitialmatrix(P2(gx_device *, gs_matrix *));
  77.  
  78. /* VMS limits identifiers to 31 characters. */
  79. int gs_get_device_or_hw_params(P3(gx_device *, gs_param_list *, bool));
  80. #define gs_getdeviceparams(dev, plist)\
  81.   gs_get_device_or_hw_params(dev, plist, false)
  82. #define gs_gethardwareparams(dev, plist)\
  83.   gs_get_device_or_hw_params(dev, plist, true)
  84. /* BACKWARD COMPATIBILITY */
  85. #define gs_get_device_or_hardware_params gs_get_device_or_hw_params
  86.  
  87. int gs_putdeviceparams(P2(gx_device *, gs_param_list *));
  88. int gs_closedevice(P1(gx_device *));
  89.  
  90. /* Device procedures involving an imager state. */
  91.  
  92. #ifndef gs_imager_state_DEFINED
  93. #  define gs_imager_state_DEFINED
  94. typedef struct gs_imager_state_s gs_imager_state;
  95. #endif
  96.  
  97. int gs_imager_putdeviceparams(P3(gs_imager_state *pis, gx_device *dev,
  98.                  gs_param_list *plist));
  99.  
  100. /* Device procedures involving a graphics state. */
  101.  
  102. #ifndef gs_state_DEFINED
  103. #  define gs_state_DEFINED
  104. typedef struct gs_state_s gs_state;
  105. #endif
  106.  
  107. int gs_flushpage(P1(gs_state *));
  108. int gs_copypage(P1(gs_state *));
  109. int gs_output_page(P3(gs_state *, int, int));
  110. int gs_nulldevice(P1(gs_state *));
  111. int gs_setdevice(P2(gs_state *, gx_device *));
  112. int gs_setdevice_no_erase(P2(gs_state *, gx_device *));        /* returns 1 */
  113.                         /* if erasepage required */
  114. int gs_setdevice_no_init(P2(gs_state *, gx_device *));
  115. gx_device *gs_currentdevice(P1(const gs_state *));
  116.  
  117. /* gzstate.h redefines the following: */
  118. #ifndef gs_currentdevice_inline
  119. #  define gs_currentdevice_inline(pgs) gs_currentdevice(pgs)
  120. #endif
  121.  
  122. int gs_state_putdeviceparams(P2(gs_state *pgs, gs_param_list *plist));
  123.  
  124. #endif /* gsdevice_INCLUDED */
  125.